import { ChildrensVideo, RegularVideo, Video } from "./video";
import { VideoType } from "./video-type";

export const videos: Video[] = [];

export function addVideo(title:string, type: VideoType) {
  switch (type) {
    case VideoType.CHILDRENS:
      videos.push(new ChildrensVideo(title, type))
      break;
    default:
      videos.push(new RegularVideo(title, type))
      break;
  }
}

export function getVideoType(title: string) {
  const video = videos.find(video => video.title === title);
  return video?.type || VideoType.REGULAR;
}
